package old.ships;

//provides static method for checking if a CombatObject has received a valid message

public final class ObjectMessageCheck 
{	
	private ObjectMessageCheck(){};
	
	public static boolean validMessage(String object, String message)
	{
		if (object.equalsIgnoreCase("COMBAT_SHIP"))
		{
			if (message.equalsIgnoreCase("DESTROYED") |
					message.equalsIgnoreCase("ENGINE_DESTROYED") |
					message.equalsIgnoreCase("ENGINE_REPAIRED") |
					message.equalsIgnoreCase("CHANGE_WEAP_STATUS") |
					message.equalsIgnoreCase("CHANGE_MISS_STATUS") |
					message.equalsIgnoreCase("CHANGE_FITR_STAUTS") |
					message.equalsIgnoreCase("CHANGE_ECM_STATUS") |
					message.equalsIgnoreCase("NEW_TARGETS") |
					message.equalsIgnoreCase("ADD_TARGETS") |
					message.equalsIgnoreCase("REM_TARGETS") |
					message.equalsIgnoreCase("MISS_ATTACK") |
					message.equalsIgnoreCase("WEAP_ATTACK") |
					message.equalsIgnoreCase("FITR_ATTACK") |
					message.equalsIgnoreCase("SPEC_ATTACK") |
					message.equalsIgnoreCase("DEFEND") |
					message.equalsIgnoreCase("SELF_DESTRUCT"))
			{return true;}
			else
			{return false;}			
		}
		else if (object.equalsIgnoreCase("PLANET"))
		{
			return false;
			
		}
		else if (object.equalsIgnoreCase("MISSILE"))
		{
			return false;
		}
		else if (object.equalsIgnoreCase("FIGHTER"))
		{
			return false;
			
		}
		else if (object.equalsIgnoreCase("SUPPLY_SHIP"))
		{
			return false;
			
		}
		else if (object.equalsIgnoreCase("ORBITAL"))
		{
			return false;
			
		}
		else if (object.equalsIgnoreCase("PLANET_WEAP"))
		{
			return false;
			
		}
		else if (object.equalsIgnoreCase("PLANET_MISS"))
		{
			return false;
			
		}
		else if (object.equalsIgnoreCase("BLACKHOLE"))
		{
			return false;
			
		}
		else if (object.equalsIgnoreCase("FORMATION_AI"))
		{
			if (message.equalsIgnoreCase("OVERWRITE_WAYPTS") |
					message.equalsIgnoreCase("OVERWRITE_WAYPTS_ALLSPEED") |
					message.equalsIgnoreCase("ADD_WAYPTS") |
					message.equalsIgnoreCase("ADD_WAYPTS_ALLSPEED") |
					message.equalsIgnoreCase("REM_WAYPTS") |
					message.equalsIgnoreCase("SCATTER") |
					message.equalsIgnoreCase("ADD_SHIPS") |
					message.equalsIgnoreCase("REM_SHIPS") |
					message.equalsIgnoreCase("FORMATION_COLUMNS") |
					message.equalsIgnoreCase("FORMATION_CIRCLE") |
					message.equalsIgnoreCase("FORMATION_VANGUARD") |
					message.equalsIgnoreCase("FORMATION_HALFCIRCLE") |
					message.equalsIgnoreCase("FORMATION_STAGGERED") |
					message.equalsIgnoreCase("OVERWRITE_STOP") |
					message.equalsIgnoreCase("STOP") |
					message.equalsIgnoreCase("GO") |
					message.equalsIgnoreCase("RETREAT") |
					message.equalsIgnoreCase("JUMP_TO"))
			{return true;}
			else
			{return false;}					
		}
		else if (object.equalsIgnoreCase("FLEET_AI"))
		{
			return false;			
		}
		else if (object.equalsIgnoreCase("REFEREE"))
		{
			if (message.equalsIgnoreCase("SLOWDOWN"))
			{return true;}
			else
			{return false;}
			
		}
		else 
		{
			return false;
		}
		
		
	}
	
	

}
